package com.dfbz.netctoss.service.impl;

import com.dfbz.netctoss.entity.Account;
import com.dfbz.netctoss.entity.Role;
import com.dfbz.netctoss.mapper.AccountMapper;
import com.dfbz.netctoss.mapper.RoleMapper;
import com.dfbz.netctoss.service.AccountService;
import com.dfbz.netctoss.service.RoleService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class RoleServiceImpl implements RoleService {

    @Autowired
    RoleMapper mapper;

    @Override
    public PageInfo<Role> selectPage(int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<Role> roles = mapper.findRoles();
        return new PageInfo<>(roles);
    }
}
